import collections
class Solution(object):
    def checkAlmostEquivalent(self, word1, word2):
        c1 = collections.Counter(word1)
        c2 = collections.Counter(word2)
        for i in range(26):
            key = chr(i + ord('a'))
            if abs(c1[key] - c2[key]) > 3:
                return False
        return True